package com.dream.technology.mockTest;

import com.dream.technology.controller.RcFlowParentController;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

/**
 * 描述：
 *
 * @author chen_q_i@163.com
 * 2019/3/26 : 14:52.
 * @version : 1.0
 */
@ActiveProfiles("prd")
@RunWith(SpringRunner.class)
@SpringBootTest
public class FlowT {


@Autowired
private RcFlowParentController rcFlowParentController;
    private MockMvc mvc;

    @Before
    public void setup(){
        mvc = MockMvcBuilders.standaloneSetup(rcFlowParentController).build();
    }


    @Test
    public void exampleTest() throws Exception {
        this.mvc.perform(get("/risk/admin/parent_flow/list").accept(MediaType.APPLICATION_JSON)
                ).andExpect(status().isOk())
                .andDo(MockMvcResultHandlers.print());
    }
}
